Math.floor bug

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: imaqine, 99jonathan, roger

Posts: 54
Joined: Wed Mar 14, 2012 9:10 am

Math.floor bug

Postby matejdro » Wed Apr 04, 2012 3:30 pm

Code: Select all

Math.floor(4.0 / 8.0)

Above code returns -1, while it should return 0. Any idea, what am I doing wrong?

leJOS Team Member
Posts: 1550
Joined: Thu Oct 30, 2008 4:54 pm

Re: Math.floor bug

Postby skoehler » Wed Apr 04, 2012 4:28 pm


We will probably release an upgrade (0.9.1-3) which contains the fixes.
For now, just copy the floor/ceil/round methods from the SVN version of java.lang.Math to one of your own classes, and call them instead of java.lang.Math.

Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 1 guest