Revision: 1412 Author: jsuijs Date: Sat Oct 24 10:49:37 2009 Log: jsg fixes http://code.google.com/p/jallib/source/detail?r=1412
Modified: /trunk/include/jal/rtc_isr_tmr0.jal /trunk/include/jal/sqrt.jal ======================================= --- /trunk/include/jal/rtc_isr_tmr0.jal Sat Oct 24 05:57:20 2009 +++ /trunk/include/jal/rtc_isr_tmr0.jal Sat Oct 24 10:49:37 2009 @@ -13,7 +13,7 @@ -- about once per second. -- The precision is 0.2 ppm, the accuracy depends -- on the Xtal used. -- -- --- Notes: This is the Bresenham Line Algorithm, invented at IBM in 1962, +-- Notes : This is the Bresenham Line Algorithm, invented at IBM in 1962, -- which gets an accurate end result by summing the small errors resulting of -- taking discrete steps and correcting when the error gets too large. This -- means that individual second lengths may show some jitter, but that long-term ======================================= --- /trunk/include/jal/sqrt.jal Sat Oct 24 05:27:44 2009 +++ /trunk/include/jal/sqrt.jal Sat Oct 24 10:49:37 2009 @@ -1,14 +1,22 @@ --- sqrt.jal - -; http://www.azillionmonkeys.com/qed/sqroot.html -; -; xest ? (xest + y/xest) / 2 -; -; in 4 itteraties met de juiste preset (xest) wordt de sqrt van ieder (?) dword berekend (+/- 1) -; - - -function sqrt(sdword in invalue) return sword is +-- Title: sqrt - dword sqrt +-- Author: Joep Suijs, Copyright (c) 2009, all rights reserved. +-- Adapted-by: +-- Compiler: >=2.4i +-- +-- This file is part of jallib (http://jallib.googlecode.com) +-- Released under the ZLIB license (http://www.opensource.org/licenses/zlib-license.html) +-- +-- Description: this library provides sqrt. +-- The param is a dword, the result a word. Rounding of the result can be wrong +-- +-- Sources: +-- http://www.azillionmonkeys.com/qed/sqroot.html +-- xest = (xest + y/xest) / 2 +-- with the rigth preset of xest, the result is calculated in 4 itterations (+/- 1) +-- + + +function sqrt(dword in invalue) return word is var dword xest if (invalue < 10_000) then --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jallib?hl=en -~----------~----~----~----~------~----~------~--~---
