imath library - General Help and Assistance on using CHDK stable releases - CHDK Forum supplierdeeply

imath library

  • 4 Replies
  • 2769 Views
imath library
« on: 12 / January / 2019, 04:27:28 »
Advertisements
I read several scripts that call imath functions and have tried to reverse engineer how they are used.

My Lua scripting to date has only been carried out in the Magic Lantern Lua environment, where I’m not restricted to integers.

Despite my reverse engineering attempts, I’m still confused. Is there a tutorial on using the imath library?  Or do I simply persevere with my self education?

Cheers

Garry

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: imath library
« Reply #1 on: 12 / January / 2019, 07:38:00 »
ML Lua and CHDK Lua are different.

The CHDK package contains an example script. You can find it here too: https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/CHDK/SCRIPTS/TEST/imath.lua

=> https://chdk.wikia.com/wiki/Lua/Lua_Reference#Constants

edit: Here is a very big script with some calculations, especially the sun times function: https://app.assembla.com/spaces/chdkde/subversion/source/HEAD/scripts/twilight/twilive.lua

msl
« Last Edit: 12 / January / 2019, 07:51:05 by msl »
CHDK-DE:  CHDK-DE links

Re: imath library
« Reply #2 on: 12 / January / 2019, 08:14:17 »
@msl

Many thanks, I’ll have look.

Cheers

Garry

Re: imath library
« Reply #3 on: 12 / January / 2019, 10:03:22 »
Is there a tutorial on using the imath library?  Or do I simply persevere with my self education?

You can find a complete condensed list of the imath functions here :  CHDK Scripting Cross Reference if you scroll way down to the section labelled imath functions.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: imath library
« Reply #4 on: 12 / January / 2019, 10:42:10 »
@waterwingz  and All

Thanks for the pointers.

The main issue is getting my head around mixed integer math using the imath functions and integer variables, ie keeping track of the 1000s.

Once again thanks, I’m confident I’ll get there.

Cheers

Garry

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal