SRL Archive - OSR Help

Is real not possible?


Fwd Motion

2012-03-06 14:55:37

I've programmed with Pascal in the past, and I have used a lot of real variables rather than integers, but I came to a point where I need to use a real variable today, but I keep getting "Unknown type 'real'"

Does simba not support real?

Runaway

2012-03-06 14:57:56

If you don't mind me asking, what's the difference between a real variable and an integer?

footballjds

2012-03-06 14:58:01

From: Fwd Motion
I've programmed with Pascal in the past, and I have used a lot of real variables rather than integers, but I came to a point where I need to use a real variable today, but I keep getting "Unknown type 'real'"

Does simba not support real?


what're you trying to do that you need this?
what about using an extended?

Fwd Motion

2012-03-06 14:59:36

From: footballjds
what're you trying to do that you need this?


More specific equations, as far as I know (which isn't much), its the only way to really use decimals.

Integers round up always, I need it to always round down, which is possible with real.

Runaway

2012-03-06 15:00:23

From: Fwd Motion
More specific equations, as far as I know (which isn't much), its the only way to really use decimals.

Integers round up always, I need it to always round down, which is possible with real.


Use the extended type and the ceil() or round() functions with it.

ceil() rounds the decimal up and round() rounds it down.

footballjds

2012-03-06 15:01:26

From: Runaway
Use the extended type and the ceil() or round() functions with it.

ceil() rounds the decimal up and round() rounds it down.


no, i think he needs to use floor() round() rounds it :P

masterBB

2012-03-06 15:01:49

Just use extended, from what language comes the real type?

edit: Remembered, real is used with databases!

Fwd Motion

2012-03-06 15:01:54

From: Runaway
Use the extended type and the ceil() or round() functions with it.

ceil() rounds the decimal up and round() rounds it down.


Thanks so much!

I'll mess with it now!

Runaway

2012-03-06 15:02:08

From: footballjds
no, i think he needs to use floor() round() rounds it :P


Right, silly me :P

Fwd Motion

2012-03-06 15:04:37

From: masterBB
Just use extended, from what language comes the real type?

edit: Remembered, real is used with databases!


http://www.taoyue.com/tutorials/pascal/pas1d.html

masterBB

2012-03-06 15:15:40

From: Fwd Motion
http://www.taoyue.com/tutorials/pascal/pas1d.html


I'm a bit used to floats ;) Never knew pascal uses real, oh wel, learned something new.