Hello, Im a newbie and Im starting with something small (radius/circumference calculator) but I'm hacing trouble with floats. What data type do I use? And what functions? Will IMUL and IDIV work?

Edit: Also,how do I make an Edit box accept only numbers?
Posted on 2005-04-26 21:40:04 by Tyrant
Hello, Im a newbie and Im starting with something small (radius/circumference calculator) but I'm hacing trouble with floats. What data type do I use? And what functions? Will IMUL and IDIV work?


The IMUL and IDIV instructions will not work for fractional computation unless you intend to use fixed point math with the CPU integer instructions.

Before you start coding the FPU for floating point math, you may want to have a look at the following tutorial. Although all coding examples are in MASM syntax, you should still find it useful, specially the first 2 chapters.

http://www.ray.masmcode.com/index.html#fputut

(For your interest, the above site also has a section on fixed point math.)

Also,how do I make an Edit box accept only numbers?


Include the ES_NUMBER style. However, be aware that this style will NOT allow other characters such as the "-" sign or a decimal point.

Raymond
Posted on 2005-04-27 11:19:44 by Raymond
I've already tried simple progs for Dos, etc. and now im using Masm32 so this will work. Thank you very much.
Posted on 2005-04-27 22:10:57 by Tyrant