@@ -802,55 +802,61 @@ pub fn subtract(a: Int, b: Int) -> Int {
802
802
}
803
803
804
804
/// Calculates the bitwise AND of its arguments.
805
- pub fn bitwise_and ( x : Int , y : Int ) -> Int {
806
- do_and ( x , y )
807
- }
808
-
805
+ ///
806
+ /// The exact behaviour of this function depends on the target platform.
807
+ /// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
808
+ /// is equivalent to bitwise operations on big-ints.
809
+ ///
809
810
@ external ( erlang , "erlang" , "band" )
810
811
@ external ( javascript , "../gleam_stdlib.mjs" , "bitwise_and" )
811
- fn do_and ( a : Int , b : Int ) -> Int
812
+ pub fn bitwise_and ( x : Int , y : Int ) -> Int
812
813
813
814
/// Calculates the bitwise NOT of its argument.
814
- pub fn bitwise_not ( x : Int ) -> Int {
815
- do_not ( x )
816
- }
817
-
815
+ ///
816
+ /// The exact behaviour of this function depends on the target platform.
817
+ /// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
818
+ /// is equivalent to bitwise operations on big-ints.
819
+ ///
818
820
@ external ( erlang , "erlang" , "bnot" )
819
821
@ external ( javascript , "../gleam_stdlib.mjs" , "bitwise_not" )
820
- fn do_not ( a : Int ) -> Int
822
+ pub fn bitwise_not ( x : Int ) -> Int
821
823
822
824
/// Calculates the bitwise OR of its arguments.
823
- pub fn bitwise_or ( x : Int , y : Int ) -> Int {
824
- do_or ( x , y )
825
- }
826
-
825
+ ///
826
+ /// The exact behaviour of this function depends on the target platform.
827
+ /// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
828
+ /// is equivalent to bitwise operations on big-ints.
829
+ ///
827
830
@ external ( erlang , "erlang" , "bor" )
828
831
@ external ( javascript , "../gleam_stdlib.mjs" , "bitwise_or" )
829
- fn do_or ( a : Int , b : Int ) -> Int
832
+ pub fn bitwise_or ( x : Int , y : Int ) -> Int
830
833
831
834
/// Calculates the bitwise XOR of its arguments.
832
- pub fn bitwise_exclusive_or ( x : Int , y : Int ) -> Int {
833
- do_exclusive_or ( x , y )
834
- }
835
-
835
+ ///
836
+ /// The exact behaviour of this function depends on the target platform.
837
+ /// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
838
+ /// is equivalent to bitwise operations on big-ints.
839
+ ///
836
840
@ external ( erlang , "erlang" , "bxor" )
837
841
@ external ( javascript , "../gleam_stdlib.mjs" , "bitwise_exclusive_or" )
838
- fn do_exclusive_or ( a : Int , b : Int ) -> Int
842
+ pub fn bitwise_exclusive_or ( x : Int , y : Int ) -> Int
839
843
840
844
/// Calculates the result of an arithmetic left bitshift.
841
- pub fn bitwise_shift_left ( x : Int , y : Int ) -> Int {
842
- do_shift_left ( x , y )
843
- }
844
-
845
+ ///
846
+ /// The exact behaviour of this function depends on the target platform.
847
+ /// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
848
+ /// is equivalent to bitwise operations on big-ints.
849
+ ///
845
850
@ external ( erlang , "erlang" , "bsl" )
846
851
@ external ( javascript , "../gleam_stdlib.mjs" , "bitwise_shift_left" )
847
- fn do_shift_left ( a : Int , b : Int ) -> Int
852
+ pub fn bitwise_shift_left ( x : Int , y : Int ) -> Int
848
853
849
854
/// Calculates the result of an arithmetic right bitshift.
850
- pub fn bitwise_shift_right ( x : Int , y : Int ) -> Int {
851
- do_shift_right ( x , y )
852
- }
853
-
855
+ ///
856
+ /// The exact behaviour of this function depends on the target platform.
857
+ /// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
858
+ /// is equivalent to bitwise operations on big-ints.
859
+ ///
854
860
@ external ( erlang , "erlang" , "bsr" )
855
861
@ external ( javascript , "../gleam_stdlib.mjs" , "bitwise_shift_right" )
856
- fn do_shift_right ( a : Int , b : Int ) -> Int
862
+ pub fn bitwise_shift_right ( x : Int , y : Int ) -> Int
0 commit comments