gluabit32

package module
v0.0.0-...-cb1e799 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2019 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

bit32 for GopherLua

A native Go implementation of bit32 for the GopherLua VM.

Using

Loading Module
import (
	"github.com/nubix-io/gluabit32"
)

// Bring up a GopherLua VM
L := lua.NewState()
defer L.Close()

// Preload bit32 module
gluabit32.Preload(L)
Invoking functions
script := `
  local bit32 = require 'bit32'
  return bit32.rshift(5, 1), bit32.rshift(0xffffffff, 0)`
L.DoString(script)
assert.equal(2, L.ToString(-2))
assert.equal(4294967295, L.ToString(-1))

Testing

$ go test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(l *lua.LState) int

func Preload

func Preload(L *lua.LState)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址