simple float query

BlitzMax Forums/BlitzMax Beginners Area/simple float query

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

As above.

When you specify a `number` in BlitzMax, you are basically defining a CONST (constant). If you don't provide any decimal portion of any kind it assumes it is an integer. If you provide a decimal even if it's .0 it will make it into a float constant. The math obviously differs depending on the type. 600/155 in integer math ignores the fractional part of the result. So as Suco-X said, just add .something to the end of the number and you'll clue Blitz in to know to make it a floating point sum. You only have to add .0 to one of the numbers because that overrides the type of the other number.