Post Reply 
Numworks - Question about frac()
03-03-2023, 08:16 AM (This post was last modified: 03-03-2023 09:14 AM by rkf.)
Post: #2
RE: Numworks - Question about frac()
Obviously, the implementations differ for negative arguments. Unfortunately, I'm unfamiliar with C, but who is, may have a look at the source of Numwork's frac here.

I guess Numwork uses floor C function, which gives -4 when applied to -3.95, and if you subtract -4 from -3.95, you are given 0.05?

Also I guess HP is simply truncating what's on the left hand side of the decimal point, so -0.95 is remaining. HP code aficionados know better for sure.

At the end of the day, mathematically speaking 0.05 and -0.95 are the same modulo 1. :-)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Numworks - Question about frac() - Pälzer - 03-02-2023, 11:45 PM
RE: Numworks - Question about frac() - rkf - 03-03-2023 08:16 AM



User(s) browsing this thread: 1 Guest(s)