Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bc's math
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
skunk
l33t
l33t


Joined: 28 May 2003
Posts: 646
Location: granada, spain

PostPosted: Tue Sep 30, 2014 12:21 am    Post subject: bc's math Reply with quote

Code:

skunk@mescalito ~ $ x=8.24E-7
skunk@mescalito ~ $ echo "$x > 1"|bc -l
1
skunk@mescalito ~ $ echo "$x < 1"|bc -l
0
skunk@mescalito ~ $ x=8.24E-8
skunk@mescalito ~ $ echo "$x > 1"|bc -l
0
skunk@mescalito ~ $ echo "$x < 1"|bc -l
1

please, somebody minds to explain?
Back to top
View user's profile Send private message
Akkara
Bodhisattva
Bodhisattva


Joined: 28 Mar 2006
Posts: 6702
Location: &akkara

PostPosted: Tue Sep 30, 2014 1:46 am    Post subject: Reply with quote

bc does not parse scientific notation written using the "E" form.

Write it like 1.234*10^-5 instead
_________________
Many think that Dilbert is a comic. Unfortunately it is a documentary.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
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