draw2d/postscript-go/src/pkg/postscript/operators_relational.go

23 lines
546 B
Go
Raw Normal View History

2010-12-13 12:01:24 +00:00
// Copyright 2010 The postscript-go Authors. All rights reserved.
// created: 13/12/2010 by Laurent Le Goff
package postscript
func eq(interpreter *Interpreter) {
value1 := interpreter.Pop()
value2 := interpreter.Pop()
interpreter.Push(value1 == value2)
}
func lt(interpreter *Interpreter) {
f2 := interpreter.PopFloat()
f1 := interpreter.PopFloat()
interpreter.Push(f1 < f2)
}
func initRelationalOperators(interpreter *Interpreter) {
interpreter.SystemDefine("eq", NewOperator(eq))
interpreter.SystemDefine("lt", NewOperator(lt))
2010-12-13 12:01:24 +00:00
}