Language: C++

#include<bits/stdc++.h>
using namespace std;

using ll=long long;
using P=pair<ll,ll>;
#define mod 1000000007

ll gcd(ll a,ll b){
  if(a%b==0) return b;
  else{
    return gcd(b,a%b);
  }
}

ll modpow(ll n,ll m=mod-2){
  ll r=1;
  while(m) r=r*((m%2)?n:1)%mod,n=n*n%mod,m>>=1;
  return r;
}

int main(){

  int n;
  cin >> n;

  map<P,P> mp;
  long long zero=0;
  int sum = 1;

  for(int i=0;i<n;i++){
    long double a,b;
    cin >> a >> b;
    if(a==0 && b==0) zero++;
    else if(a==0){
      mp[make_pair(0,1)].first++;
      mp[make_pair(0,1)].second++;
    }else if(b==0){
      mp[make_pair(1,0)].first++;
      mp[make_pair(1,0)].second;
    }else{
      ll g = abs(gcd(a, b));
      a=a/g;
      b=b/g;
      if(mp[make_pair(b,-a)].first>0) mp[make_pair(b,-a)].second++;
      else if(mp[make_pair(-b,a)].first>0) mp[make_pair(-b,a)].second++;
      else mp[make_pair(a,b)].first++;
    }
  }

  for(auto p:mp){
    ll s = p.second.first;
    ll t = p.second.second;
    ll now = 1;
    now += modpow(2,s)-1;
    now += modpow(2,t)-1;
    sum *= now;
    sum = sum%mod;
  }

  sum -= 1;
  sum += zero %mod;
  cout << sum << endl;

}

Compiler output:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = long double; _Nn = long double; common_type_t<_Mn, _Nn> = long double]':
a.cc:41:21:   required from here
   41 |       ll g = abs(gcd(a, b));
      |                  ~~~^~~~~~
/usr/include/c++/14/numeric:175:21: error: static assertion failed: std::gcd arguments must be integers
  175 |       static_assert(is_integral_v<_Mn> && is_integral_v<_Nn>,
      |                     ^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/numeric:175:21: note: 'std::is_integral_v<long double>' evaluates to false
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In instantiation of 'struct std::make_unsigned<long double>':
/usr/include/c++/14/type_traits:2076:11:   required by substitution of 'template<class _Tp> using std::make_unsigned_t = typename std::make_unsigned::type [with _Tp = long double]'
 2076 |     using make_unsigned_t = typename make_unsigned<_Tp>::type;
      |           ^~~~~~~~~~~~~~~
/usr/include/c++/14/numeric:182:24:   required from 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = long double; _Nn = long double; common_type_t<_Mn, _Nn> = long double]'
  182 |       return __detail::__gcd<make_unsigned_t<_Ct>>(__m2, __n2);
      |              ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:41:21:   required from here
   41 |       ll g = abs(gcd(a, b));
      |                  ~~~^~~~~~
/usr/include/c++/14/type_traits:1929:13: error: invalid use of incomplete type 'class std::__make_unsigned_selector<long double, false, false>'
 1929 |     { using type = typename __make_unsigned_selector<_Tp>::__type; };
      |             ^~~~
/usr/include/c++/14/type_traits:1837:11: note: declaration of 'class std::__make_unsigned_selector<long double, false, false>'
 1837 |     class __make_unsigned_selector;
      |           ^~~~~~~~~~~~~~~~~~~~~~~~