Notifications
Clear all

[Closed] Math op

Probably something very simple , yet I can find a way to do this.

I`m reading a byte as Uint8 from binary file, so say my int is 119 and I need to divide it by 255 so that I get 0.52888888888888888888888888888889.

bbw1 = ReadByte f #unsigned/255 does not work.

How do I do this?

5 Replies

bbw1 = (ReadByte f #unsigned) / 255.

?

3 Replies
(@dainiuxxx)
Joined: 10 months ago

Posts: 0

yeah that returns a plain 0 and I need 0.52888888888888888888888888888889

(@nirrol)
Joined: 10 months ago

Posts: 0

“a plain 0” sounds to me like an integer division – Did you miss the “.” at the end?

(@dainiuxxx)
Joined: 10 months ago

Posts: 0

You are correct sir I did miss the “.” . Both suggestions works just fine.
Thanks guys.

(readbyte f #unsigned) as float / 255