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?

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

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

I've already tried simple progs for Dos, etc. and now im using Masm32 so this will work. Thank you very much.