Author Topic: FLOOR()  (Read 2058 times)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2621
    • View Profile
FLOOR()
« on: 2016-Nov-09 »
Undocumented? Seems to be present but not in the docs?

Handy to have all the same.  ;)
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4202
    • View Profile
    • Portfolio
Re: FLOOR()
« Reply #1 on: 2016-Nov-09 »
what does it do?

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10708
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: FLOOR()
« Reply #2 on: 2016-Nov-09 »
Cut post-decimal sign figures.
Floor(9.999) is 9.0

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10708
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: FLOOR()
« Reply #3 on: 2016-Nov-09 »
Ceil rounds to the next full integer. Ceil(1.01) is 2.0

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4202
    • View Profile
    • Portfolio
Re: FLOOR()
« Reply #4 on: 2016-Nov-09 »
Nice...it does look like the things that could help me a lot on a couple fronts, thanks! :good:

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3626
    • View Profile
    • Space Fractal
Re: FLOOR()
« Reply #5 on: 2016-Nov-09 »
FLOOR() is same as INTEGER()? Im have used INTEGER() various time.

This hence its been undocumented.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2621
    • View Profile
Re: FLOOR()
« Reply #6 on: 2016-Nov-10 »
Mathematicaly Floor() rounds down, INTEGER() truncates. This is especially evident when you use negative floating point numbers. Try -4.6 in both and you should get different results.
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)