Re: Stuck on whole numbers.
From: Stephane CHAZELAS (stephane_chazelas_at_yahoo.fr)
Date: 09/27/03
- Next message: Stephane CHAZELAS: "Re: ksh93: How to avoid duplicates in history?"
- Previous message: claudibus: "[bash] [redirection] appending using a file descriptor"
- In reply to: Chris F.A. Johnson: "Re: Stuck on whole numbers."
- Next in thread: laura fairhead: "Re: Stuck on whole numbers."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Sep 2003 09:29:47 GMT
Chris F.A. Johnson wrote:
[...]
> 1. Use ksh93; it handles real numbers, which most shells do not
zsh does.
> (note the dot after 4 to force floating point interpretation):
only in locales (LC_NUMERIC) where the decimal point is a dot.
>
> echo $(( 2 / 4. ))
[...]
In a french locale for instance, that would be
echo $(( 2 / 4, ))
~$ ksh93 -c 'echo $(( 2 / 4. ))'
ksh93: line 1: 2 / 4. : arithmetic syntax error
~$ locale -k LC_NUMERIC
decimal_point=","
thousands_sep=""
grouping=-1;-1
numeric-decimal-point-wc=44
numeric-thousands-sep-wc=0
numeric-codeset="ISO-8859-1"
-- Stéphane
- Next message: Stephane CHAZELAS: "Re: ksh93: How to avoid duplicates in history?"
- Previous message: claudibus: "[bash] [redirection] appending using a file descriptor"
- In reply to: Chris F.A. Johnson: "Re: Stuck on whole numbers."
- Next in thread: laura fairhead: "Re: Stuck on whole numbers."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|