use * for pointer type instead of &
See #770 To help automatically translate code, see the zig-fmt-pointer-reform-2 branch. This will convert all & into *. Due to the syntax ambiguity (which is why we are making this change), even address-of & will turn into *, so you'll have to manually fix thes instances. You will be guaranteed to get compile errors for them - expected 'type', found 'foo'
This commit is contained in:
@@ -28,13 +28,13 @@ fn testDivision() void {
|
||||
assert(divTrunc(f32, -5.0, 3.0) == -1.0);
|
||||
|
||||
comptime {
|
||||
assert(1194735857077236777412821811143690633098347576 % 508740759824825164163191790951174292733114988 == 177254337427586449086438229241342047632117600);
|
||||
assert(@rem(-1194735857077236777412821811143690633098347576, 508740759824825164163191790951174292733114988) == -177254337427586449086438229241342047632117600);
|
||||
assert(1194735857077236777412821811143690633098347576 / 508740759824825164163191790951174292733114988 == 2);
|
||||
assert(@divTrunc(-1194735857077236777412821811143690633098347576, 508740759824825164163191790951174292733114988) == -2);
|
||||
assert(@divTrunc(1194735857077236777412821811143690633098347576, -508740759824825164163191790951174292733114988) == -2);
|
||||
assert(@divTrunc(-1194735857077236777412821811143690633098347576, -508740759824825164163191790951174292733114988) == 2);
|
||||
assert(4126227191251978491697987544882340798050766755606969681711 % 10 == 1);
|
||||
assert(1194735857077236777412821811143690633098347576 % 508740759824825164163191790951174292733114988 == 177254337427586449086438229241342047632117600,);
|
||||
assert(@rem(-1194735857077236777412821811143690633098347576, 508740759824825164163191790951174292733114988) == -177254337427586449086438229241342047632117600,);
|
||||
assert(1194735857077236777412821811143690633098347576 / 508740759824825164163191790951174292733114988 == 2,);
|
||||
assert(@divTrunc(-1194735857077236777412821811143690633098347576, 508740759824825164163191790951174292733114988) == -2,);
|
||||
assert(@divTrunc(1194735857077236777412821811143690633098347576, -508740759824825164163191790951174292733114988) == -2,);
|
||||
assert(@divTrunc(-1194735857077236777412821811143690633098347576, -508740759824825164163191790951174292733114988) == 2,);
|
||||
assert(4126227191251978491697987544882340798050766755606969681711 % 10 == 1,);
|
||||
}
|
||||
}
|
||||
fn div(comptime T: type, a: T, b: T) T {
|
||||
@@ -324,8 +324,8 @@ test "big number addition" {
|
||||
|
||||
test "big number multiplication" {
|
||||
comptime {
|
||||
assert(45960427431263824329884196484953148229 * 128339149605334697009938835852565949723 == 5898522172026096622534201617172456926982464453350084962781392314016180490567);
|
||||
assert(594491908217841670578297176641415611445982232488944558774612 * 390603545391089362063884922208143568023166603618446395589768 == 232210647056203049913662402532976186578842425262306016094292237500303028346593132411865381225871291702600263463125370016);
|
||||
assert(45960427431263824329884196484953148229 * 128339149605334697009938835852565949723 == 5898522172026096622534201617172456926982464453350084962781392314016180490567,);
|
||||
assert(594491908217841670578297176641415611445982232488944558774612 * 390603545391089362063884922208143568023166603618446395589768 == 232210647056203049913662402532976186578842425262306016094292237500303028346593132411865381225871291702600263463125370016,);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user