Skip to content

About DLR and other funny things.

November 7, 2009

DLR

(Dynamic Runtime Library) is microsoft latest technology that will prove itself as long as .NET struggle to survive.

however this is an old news, you must heard about IronPython, and IronRuby.

 

My Quantity System Calculator is build over the DLR expressions. This has permitted me to do a numerous things in my calculator.

I added functions, new sequence concept, and lately implemented NameSpaces.

the latest DLR version is 0.92 and you can get it from http://dlr.codeplex.com

 

Funny Things

if you download the last Quantity system sources from the source panel in code plex

and run this code

 

Qs> Sin[n](x) ..> ((-1)^n*x^(2*n+1))/(2*n+1)! #Sin sequence

Qs> Sin(x) = Sin[0++50](x) #Sin function

 

Qs> Math:Sin(8)
DimensionlessQuantity: 0.989358246623382 <1>
Qs> Sin(8)
DimensionlessQuantity: 0.989358246623403 <1>
can you notice the difference between the last 3 digits from right

the first function from the Math:Sin(8) is a direct calling for the .NET Math.Sin  function

and the second Sin(8) is a call for my sequence-series implementation.

well I have double checked by the windows calculator and the result was the same as the .NET library.

Windows Calculator Sin(8) in radian mode: 0.98935824662338177780812359824529

So which one is the right approximation 🙂

let’s try to call the SIN series with less items

 

Qs> Sin[0++20](8)

DimensionlessQuantity: 0.989358246623414 <1>

ok also have an error

let’s try it for many more items.

 

Qs> Sin[0++160](8)

DimensionlessQuantity: 0.989358246623403 <1>

we are back to the same result 🙂

damn it 😀 what should i trust more??  my sequence-series implementation or the .NET Sin implementation, and what if this was obtained from the FPU ???

 

 

I really don’t know.

 

 

 

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: