From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28271 invoked by alias); 14 May 2015 02:56:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35117 Received: (qmail 23567 invoked from network); 14 May 2015 02:56:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=0RH1eqMSEAOEYQhqx7ZIBxfhPb+VUkwddaX/s/aC4fQ=; b=IPn2GbWcDgYNshTOaqtkAfud6WqVTWyYSjDegH8V/F2EbQ1SUPDghsaKaXDJIlWC6z J1NYHoRld23TVxCib5Ks2duKBB6P3dakR39dOiXkerURk5lqZZRjr3sLYDHXI9HCyS1e HpjKLABFKTTAKAMmDCFdj+lxwPToXD8qdm/7zanAbU4KZqvwPVYFieoneRAhS9hY0C3W 5heB3VYsZtOArj9ehkzcVSMFy9OghyVVVcmiyCMfTXFSJsXBb1w5Af28046aAcSL9Emn 7kVjxtGU+lhlOfGcI+Hw66z7ArrkfiTkq1d7FY10qW0+G4gpLvDmk7IgwId3F0gbqcu7 BtxQ== X-Gm-Message-State: ALoCoQm7r9/WHD5rBVCRKOn60O2fD3SDx8bTf+Cu0wffK40+L7GBEEFHFGebLVZn0uEMyk0zDTQQ X-Received: by 10.182.130.135 with SMTP id oe7mr1650383obb.78.1431572185499; Wed, 13 May 2015 19:56:25 -0700 (PDT) From: Bart Schaefer Message-Id: <150513195617.ZM29493@torch.brasslantern.com> Date: Wed, 13 May 2015 19:56:17 -0700 In-Reply-To: <87oalodmns.fsf@debian.uxu> Comments: In reply to Emanuel Berg "why do ceil/floor give the decimal dot?" (May 14, 2:32am) References: <87oalodmns.fsf@debian.uxu> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Emanuel Berg , zsh-workers@zsh.org Subject: Re: why do ceil/floor give the decimal dot? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 14, 2:32am, Emanuel Berg wrote: } Subject: why do ceil/floor give the decimal dot? } } >From #zsh (incal == yours truly): } } why do ceil/floor give the decimal dot? } echo $(( floor(5) )) -> 5. Isn't that the } whole "point" that you want an integer? I know } I can get it with int but I thought I'd learn } if there is a reason } } incal, I suspect that's an oversight. } incal, it just uses the C floor() function, It's not an oversight. The doc says: Most functions take floating point arguments and return a floating point value. However, any necessary conversions from or to integer type will be performed automatically by the shell. Apart from atan with a second argument and the abs, int and float functions, all functions behave as noted in the manual page for the corresponding C function [...] So ciel and floor return float precisely and intentionally because the C functions do so.