View previous topic :: View next topic |
Author |
Message |
Redouane Master Cheater
Reputation: 3
Joined: 05 Sep 2013 Posts: 363 Location: Algeria
|
|
Back to top |
|
 |
vng21092 Grandmaster Cheater
Reputation: 15
Joined: 05 Apr 2013 Posts: 644
|
Posted: Tue Mar 17, 2015 9:13 am Post subject: |
|
|
hmm not sure why you would need to edit that but I just wanted to try it out here's how it turned out
Cool find, I have a thing for whole numbers I don't think its something you can edit, its preset. Like if float is "x.5" it'll round up or round down, something like that.
|
|
Back to top |
|
 |
Redouane Master Cheater
Reputation: 3
Joined: 05 Sep 2013 Posts: 363 Location: Algeria
|
Posted: Tue Mar 17, 2015 10:58 am Post subject: |
|
|
vng21092 wrote: | hmm not sure why you would need to edit that but I just wanted to try it out here's how it turned out
picture
Cool find, I have a thing for whole numbers I don't think its something you can edit, its preset. Like if float is "x.5" it'll round up or round down, something like that. |
It rounds up or down?
floor(-1.06) = -2
|
|
Back to top |
|
 |
vng21092 Grandmaster Cheater
Reputation: 15
Joined: 05 Apr 2013 Posts: 644
|
|
Back to top |
|
 |
Redouane Master Cheater
Reputation: 3
Joined: 05 Sep 2013 Posts: 363 Location: Algeria
|
Posted: Wed Mar 18, 2015 6:45 am Post subject: |
|
|
Thanks for your help,I was hoping to find a function that does floor on floats (like ntdll.Floor),or a way to change the rounding mode to make frndint always round down,thanks anyway.
|
|
Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 891
|
Posted: Wed Mar 18, 2015 3:00 pm Post subject: |
|
|
There's nothing preventing you from using a floor function in a loaded DLL (or loading a dll for the function you want). I don't know offhand how the native floor works, but I think that the msvcrt exports a floor function that takes a 4-byte float.
_________________
A nagy kapu mellett, mindig van egy kis kapu.
----------------------
Come on... |
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Mar 18, 2015 7:00 pm Post subject: |
|
|
This... should work.
Code: | alloc(myint,4)
alloc(rounddown,4)
rounddown:
dd (float)0.5
newmem:
// float already on stack
fsub [rounddown]
fistp [myint]
fild [myint]
// floor value now on stack |
|
|
Back to top |
|
 |
|