AI Zone Admin Forum Add your forum

CX Company, chatbot market leader in the Netherlands since 2005, will speak on the Amsterdam Chatbots Meetup on Wednesday, Oct 18!

How can i compare two exponential numbers ?
 
 

$a = 7.049542752056771E9
$b =  8.636434574396982E9

if($a > $b){
A is greater than B
}
else{
B is greater than A
}

 

 
  [ # 1 ]

I dont really understand the question. the code you gave works fine.  Internally the exponential text numbers are converted to doublefloat and then compared.  Your code worked fine for me in a test cast.

 

 
  [ # 2 ]

u: (test) ^keep() ^repeat()
$a = 7.049542752056771E9
$b = 4.763363383874744E9
if($a >= $b){
$a is greater than $b
}
else{
$b is greater than $a
}


It doesn’t work for the above test case, am I doing something wrongly ?

 

 
  [ # 3 ]

topic: ~INTRODUCTIONS keep repeat (~emogoodbye ~emohello ~emohowzit name here )

t: COU() Which countries have you visited?
u: (test)
$a = 7.049542752056771E9
$b =  8.636434574396982E9

if($a > $b){
A is greater than B
}
else{
B is greater than A
}
This code worked fine for me.  do a :trace all and then send me the log file if it doesnt work. What version of CS are you using?

 

 
  [ # 4 ]

I am using ChatScript Release Version 7.12.

The values used were:
$a = 7.049542752056771E9
$b = 4.763363383874744E9

Please find attached log file.
Thanks.

 

 
  [ # 5 ]

Upgrade your CS.

 

 
  [ # 6 ]

Ok Thanks

 

 
  login or register to react