flat assembler
Message board for the users of flat assembler.

Index > Main > % or mod. How calculating?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1978
Roman 11 Jul 2025, 06:36
in c++ exist %.
10 % 2
How write this on asm ?
Mod useful in this task or not ?

I do this 10 % 2 = 10*0.01*2 = 0.2
But I don't know its right or not.

or 10.0f % 2.0f what is answer ?
or 0.8f % 1.0f what is answer ?
Post 11 Jul 2025, 06:36
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1978
Roman 11 Jul 2025, 07:42
modf sse
__m128 integer = _mm_round_ps(value,_MM_FROUND_TRUNC);
__m128 fraction = _mm_sub_ps(value,integer);

modf(1.3) get 1 and 0.3 fraction
Post 11 Jul 2025, 07:42
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.