On Jun 2, 2010, at 9:18 AM, Maciej Piechotka wrote:
Hmm. C, Java & co.[1] seems to not have this problem.
Languages that do recognise a difference between
integer quotient-and-remainder and multiplicative inverse:
- MATHEMATICS
- Algol 60, Algol W, Algol 68
- BCPL (/ is integer division, #/
> [1] By co I mean Ruby, Python, Perl and others. There are no so many
> languages that do recognize the difference.
% python -Q new
Python 2.4.6 (#1, Aug 3 2009, 17:05:16)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
10 / 3
On Tue, 2010-06-01 at 15:20 -0400, Aaron D. Ball wrote:
>
> > What does (stdin + stderr) `mod` stdout mean (result will be stdin).
>
> In my GHCi (6.12.1) with System.IO, this fails because Handle is not a
> numeric type. What implementation are you using?
Ups. I missed the Handle with Fd. Whi
On Tue, 2010-06-01 at 22:40 +0200, Jonas Almström Duregård wrote:
> >> One might expect a == (a/b)*b and other common arithmetic formulas to
> >> hold for division?
>
> > Better not if one's using Float or Double.
>
> I figured someone would say that :)
>
> What about this one:
> round (a/b/c) =
On Tuesday 01 June 2010 22:40:51, Jonas Almström Duregård wrote:
> >> One might expect a == (a/b)*b and other common arithmetic formulas to
> >> hold for division?
> >
> > Better not if one's using Float or Double.
>
> I figured someone would say that :)
*g*
>
> What about this one:
> round (a/b/
>> One might expect a == (a/b)*b and other common arithmetic formulas to
>> hold for division?
> Better not if one's using Float or Double.
I figured someone would say that :)
What about this one:
round (a/b/c) == round (a/(b*c))
Of course this doesn't work on Integers...
/J
On 1 June 2010 21
On Jun 1, 2010, at 12:20 PM, Aaron D. Ball wrote:
The underlying object here is a Unix file descriptor, which is just a
number. In that sense, stdin is 0, stdout is 1, and stderr is 2, so
this would be (0 + 2) (mod 1) = 0
Every integer is 0 (mod 1).
__
> What does (stdin + stderr) `mod` stdout mean (result will be stdin).
In my GHCi (6.12.1) with System.IO, this fails because Handle is not a
numeric type. What implementation are you using?
The underlying object here is a Unix file descriptor, which is just a
number. In that sense, stdin is 0,
On Tuesday 01 June 2010 20:26:55, Jonas Almström Duregård wrote:
> One might expect a == (a/b)*b and other common arithmetic formulas to
> hold for division?
>
> /Jonas
Better not if one's using Float or Double.
___
Haskell-Cafe mailing list
Haskell-Cafe
One might expect a == (a/b)*b and other common arithmetic formulas to
hold for division?
/Jonas
On 31 May 2010 14:32, Maciej Piechotka wrote:
> I started to wonder what is the difference between div and / so they are
> 2 separate symbols.
>
> div:
> Take a Integral divide and round (down)
>
> (
I started to wonder what is the difference between div and / so they are
2 separate symbols.
div:
Take a Integral divide and round (down)
(/):
Take a Fractional divide and usually round
In some applications I would like to use any of those but it is not
possible. Is this unification taken in
11 matches
Mail list logo