MathCode and FoldList

*To*: mathgroup at smc.vnet.net*Subject*: [mg60835] MathCode and FoldList*From*: "Ruth Lazkoz" <ruth.lazkoz at ehu.es>*Date*: Fri, 30 Sep 2005 03:57:05 -0400 (EDT)*References*: <200509280541.BAA08394@smc.vnet.net> <200509290941.FAA01047@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Hi, I want to translate some code (which mathgroup helped me to construct) into C++ using MathCode. It does not understand all the functions in Mathematica, for instance, it does not take FoldList. Below there is an example of what I have to do? FoldList[ #1 + Integrate[ x, {x, #2[[1]], #2[[2]]}] &, NIntegrate[ x, {x, 0, 0.2}], {{a, b}, {c, d}, {e, f}}] Can you help me getting the same output but avoiding FoldList? Thanks in advance, Ruht ----- Original Message ----- From: <cmduncan at mines.edu> To: mathgroup at smc.vnet.net Subject: [mg60835] [mg60804] Re: [mg60779] Bug in Mathematica ? >I got the same answer plugging and chugging by copying and pasting your >email > into Mathematica (v5.1): > > In[1]:= > Integrate[Max[x,y],{x,0,1},{y,0,1}] > NIntegrate[Max[x,y],{x,0,1},{y,0,1}] > > Out[1]= > !(2/3) > > Out[2]= > 0.666667 > > Chris Duncan > > Quoting Bidule <toto at truc.com>: > >> Hi, >> >> I've computed the following two expressions: >> >> Integrate[Max[x, y], {x, 0, 1}, {y, 0, 1}] >> NIntegrate[Max[x, y], {x, 0, 1}, {y, 0, 1}] >> >> which result in very different numbers. When I calculate the integral by >> hand I get (2/3). >> >> Any thoughts ? I guess by now it's probably a known bug. (or maybe even >> a 'feature'). >> >> B. >> >> > > >

**References**:**Bug in Mathematica ?***From:*Bidule <toto@truc.com>

**Re: Bug in Mathematica ?***From:*cmduncan@mines.edu