-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhyperbolicapp.lua
More file actions
19 lines (17 loc) · 804 Bytes
/
hyperbolicapp.lua
File metadata and controls
19 lines (17 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Sample luaj code to try loading and executing the 'hyperbolic' sample library
--
-- The sample library source is in examples/jse/hyperbolic.java.
-- For this sample to work, that source must be compiled, and the class must
-- be on the class path.
--
-- First load the library via require(). This will call the public constructor
-- for the class named 'hyperbolic' if it exists, and then initialize the
-- library by invoking LuaValue.call('hyperbolic') on that instance
require 'hyperbolic'
-- Test that the table is in the globals, and the functions exist.
print('hyperbolic', hyperbolic)
print('hyperbolic.sinh', hyperbolic.sinh)
print('hyperbolic.cosh', hyperbolic.cosh)
-- Try exercising the functions.
print('sinh(0.5)', hyperbolic.sinh(0.5))
print('cosh(0.5)', hyperbolic.cosh(0.5))