SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Round Function

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Round Function
Author Message
Jeremy



Joined: 06 Dec 2000
Posts: 17

Post Round Function Reply with quote

I'm getting a divide by zero error when attempting to use the round function to change a number to an integer. A similar problem occurs when trying to use the floor function to do the same. Here are the trace results and exact error syntax:

JAL 55: ADD
JAL 55: Executing ADD("3976335872", "1023", "3976335872")
JAL Return "3976336895"
JAL 56: DIVIDE
JAL 56: Executing DIVIDE("3976336895", "1024", "3976336895")
JAL Return "3883141.499023438"
JAL 57: ROUND
JAL 57: Executing ROUND("3883141.499023438", "0", "3883141.499023438")

An error occured while executing 24x7 script.

Line 57: Division by zero.

And here is the code being executed:

Add (space_free, 1023, space_free)

Divide (space_free, 1024, space_free)

Round( space_free, 0, space_free)

Fri May 04, 2001 10:43 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Round Function Reply with quote

I guess the documentation is incorrect. The ROUND returns the result of division rounded to the closest integer number. It divides first and then rounds.

Replace lines 56 and 57 in your code with
DIVIDE(3976336895, 1024, myvariable)

: I'm getting a divide by zero error when attempting to use the round function
: to change a number to an integer. A similar problem occurs when trying to
: use the floor function to do the same. Here are the trace results and
: exact error syntax: JAL 55: ADD
: JAL 55: Executing ADD("3976335872", "1023",
: "3976335872")
: JAL Return "3976336895"
: JAL 56: DIVIDE
: JAL 56: Executing DIVIDE("3976336895", "1024",
: "3976336895")
: JAL Return "3883141.499023438"
: JAL 57: ROUND
: JAL 57: Executing ROUND("3883141.499023438", "0",
: "3883141.499023438")

: An error occured while executing 24x7 script.

: Line 57: Division by zero.

: And here is the code being executed: Add (space_free, 1023, space_free)

: Divide (space_free, 1024, space_free)

: Round( space_free, 0, space_free)

Fri May 04, 2001 11:26 am View user's profile Send private message
Jeremy



Joined: 06 Dec 2000
Posts: 17

Post Re: Round Function Reply with quote

: I guess the documentation is incorrect. The ROUND returns the result of
: division rounded to the closest integer number. It divides first and then
: rounds.

: Replace lines 56 and 57 in your code with
: DIVIDE(3976336895, 1024, myvariable)

Did you mean to say

ROUND(3976336895, 1024, myvariable)

I used that and it worked fine. Thanks!

Fri May 04, 2001 12:02 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.